import { type Dayjs } from 'dayjs';

export interface SearchInfo {
	type?: string;
	nickname?: string;
	gender?: string;
	birthYearMonth?: Dayjs;
	height?: number;
	weight?: number;
	residence?: string;
	maritalStatus?: string;
	educationLevel?: string;
	profession?: string;
	incomeStatus?: string;
	carHouseStatus?: string;
	specialNote?: string;
	partnerRequirements?: string;
	loveView?: string;
	idealPartner?: string;
	contactPhone?: string;
	avatarIds?: string;
	userId?: number;
	zodiac?: string;
	cnZodiac?: string;
	school?: string;
	educationType?: string;
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{
		title: '编码',
		dataIndex: 'code',
		width: '100px',
		key: 'code',
	},
	{
		title: '昵称',
		dataIndex: 'nickname',
		width: '120px',
		key: 'nickname',
	},
	{
		title: '性别',
		dataIndex: 'gender',
		width: '60px',
		key: 'gender',
	},
	{
		title: '出生年月',
		dataIndex: 'birthYearMonth',
		key: 'birthYearMonth',
	},
	{
		title: '身高',
		dataIndex: 'height',
		width: '60px',
		key: 'height',
	},
	{
		title: '体重',
		dataIndex: 'weight',
		width: '60px',
		key: 'weight',
	},
	{
		title: '居住所在地',
		dataIndex: 'residenceName',
		width: '180px',
		key: 'residenceName',
	},
	{
		title: '婚姻状况',
		dataIndex: 'maritalStatusName',
		key: 'maritalStatusName',
	},
	{
		title: '最高学历',
		dataIndex: 'educationLevelName',
		key: 'educationLevelName',
	},
	{
		title: '从事行业',
		dataIndex: 'professionName',
		key: 'professionName',
	},
	{
		title: '年收入',
		dataIndex: 'incomeStatusName',
		key: 'incomeStatusName',
	},
	{
		title: '车房情况',
		dataIndex: 'carHouseStatusName',
		key: 'carHouseStatusName',
	},
	{
		title: '联系方式',
		dataIndex: 'phone',
		key: 'phone',
		width: '180px',
	},
	{
		title: '星座',
		dataIndex: 'zodiacName',
		width: '100px',
		key: 'zodiacName',
	},
	{
		title: '属相',
		dataIndex: 'cnZodiacName',
		width: '60px',
		key: 'cnZodiacName',
	},
	{
		title: '学校',
		dataIndex: 'schoolName',
		key: 'schoolName',
	},
	{
		title: '教育类型',
		dataIndex: 'educationTypeName',
		width: '100px',
		key: 'educationTypeName',
	},
	{
		title: '实名',
		dataIndex: 'identityName',
		width: '90px',
		key: 'identityName',
	},
	{
		title: '是否会员',
		dataIndex: 'membershipFlag',
		width: '90px',
		key: 'membershipFlag',
	},
	{
		title: '会员类型',
		dataIndex: 'membershipName',
		width: '120px',
		key: 'membershipName',
	},
	{
		title: '会员有效期',
		dataIndex: 'membershipExpireTime',
		width: '120px',
		key: 'membershipExpireTime',
	},
	{
		title: '是否红娘',
		dataIndex: 'matchmakerFlag',
		width: '90px',
		key: 'matchmakerFlag',
	},
	{
		title: '红娘职级',
		dataIndex: 'matchmakerName',
		width: '120px',
		key: 'matchmakerName',
	},
	{
		title: '是否合伙人',
		dataIndex: 'partnerFlag',
		width: '100px',
		key: 'partnerFlag',
	},
	{
		title: '合伙人类型',
		dataIndex: 'partnerTypeName',
		width: '120px',
		key: 'partnerTypeName',
	},
	{
		title: '合伙人有效期',
		dataIndex: 'partnerExpireTime',
		width: '120px',
		key: 'partnerExpireTime',
	},
	{
		title: '操作',
		key: 'operation',
		fixed: 'right',
		width: '100px',
	},
]);

export interface DataItem {
	nickname: string;
	gender: string;
	birthYearMonth: Dayjs;
	height: number;
	weight: number;
	residence: string;
	maritalStatus: string;
	educationLevel: string;
	profession: string;
	incomeStatus: string;
	carHouseStatus: string;
	specialNote: string;
	partnerRequirements: string;
	loveView: string;
	idealPartner: string;
	contactPhone: string;
	avatarIds: string;
	userId: number;
	zodiac: string;
	cnZodiac: string;
	school: string;
	educationType: string;
}

export interface ModelInfo {
	title?: string;
	width?: string;
	id?: number | undefined;
	confirmLoading?: boolean;
}

export interface dictInfo {
	typeCode?: string | number | undefined;
	typeName?: string | undefined;
}